<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>tableFrame_simple</title>
    <link rel="stylesheet" type="text/css" href="css/base_style.css" >
    <script>
        function updateTable(data) {
            var tbody=document.getElementsByTagName("tbody")[0];
            var infos = eval(data);
            tbody.innerHTML="";
            for (var item in infos) {
                tbody.innerHTML += "<tr class='"+ (item%2==0?'row_odd':'row_even') +"' onclick='setBgColor(this)' >"
                        + "<td>" + (parseInt(item)+1) + "</td>"
                        + "<td>" + infos[item].roadLine + "</td>"
                        + "<td>" + infos[item].startPot+infos[item].startPotKm+"+"+infos[item].startPotMeter + "</td>"
                        + "<td>" + infos[item].endPot+infos[item].endPotKm+"+"+infos[item].endPotMeter + "</td>"
                        + "<td>" + infos[item].roadDate + "</td>"
                        + "<td>" + infos[item].roader + "</td>"
                        + "<td>" + (infos[item].status==0?'未上传':'已上传') + "</td>"
                        + "<td><a href='javascript:onDetailClick("+item+")'>" + infos[item].patrolDetailNum + "</a></td>"
                        + "</tr>";
            }
        }
        function onDetailClick(item) {
            window.activity.onShowPatrolDetail(item);
        }
        function setBgColor(ele)
        {
            for (var i = 0; i < ele.parentNode.rows.length; i++)
            {
                var trObj=ele.parentNode.rows[i];
                trObj.className = (i%2==0?'row_odd':'row_even');
                if(ele==trObj){
                    window.activity.onSelected(i);
                }
            }
            ele.className = 'row_selected';

        }
    </script>
</head>

<body>
<div>
    <table id="info_table" width="100%" cellpadding="0" cellspacing="0" border="1">
        <thead>
        <tr>
            <td>序号</td>
            <td>巡查路线</td>
            <td>起始桩号</td>
            <td>结束桩号</td>
            <td>巡道时间</td>
            <td>巡道人</td>
            <td>上传状态</td>
            <td>明细</td>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
</body>
</html>